package com.smithlibraties;

import com.smithlibraties.util.annotation.AnnotationClassGetter;
import com.smithlibraties.util.annotation.register.loader.EntityRegister;
import com.smithlibraties.util.annotation.register.loader.ItemBlockRegister;
import com.smithlibraties.util.annotation.register.loader.TileEntityRegister;
import com.smithlibraties.util.annotation.register.render.RegisterEntityRender;
import com.smithlibraties.util.annotation.register.render.RegisterItemRender;
import com.smithlibraties.util.annotation.register.render.RegisterTileEntityRender;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;

import java.util.List;

@Mod(modid = SmithLibraries.MODID, version = SmithLibraries.VERSION)
public class SmithLibraries {

    public static final String MODID = "smithlibraries";
    public static final String VERSION = "0.1v";

    @Mod.Instance(SmithLibraries.MODID)
    public static SmithLibraries instance;

    @EventHandler
    public void preinit(FMLPreInitializationEvent event) {
        new ItemBlockRegister();
        new EntityRegister();
        new TileEntityRegister();
    }

    @EventHandler
    public void init(FMLInitializationEvent event) {
    }

    @EventHandler
    public void postinit(FMLPostInitializationEvent event) {
        new RegisterItemRender();
        new RegisterEntityRender();
        new RegisterTileEntityRender();
    }

    private static List<Class<?>> classes = null;
    public static List<Class<?>> getAllClasses(){
        if (classes == null){
            classes = AnnotationClassGetter.getClasses("com.smithlibraties");
        }
        return classes;
    }
}
